#include <iostream>
using namespace std;
#define eleType int
struct squencelist {
	eleType* element;
	int size;
	int capcity;
};
void initlist(squencelist* list, int size, int capcity)
{
	list->element = new eleType[capcity];
	list->size = 0;
	list->capcity = capcity;
}
void destorylist(squencelist* list)
{
	delete[]list->element;
}
int size(squencelist* list)
{
	return list->size;
}
bool isEmpty(squencelist* list)
{
	return list->size == 0;
}
void insert(squencelist* list, int index, int elements)
{
	if (index < 0 || index > list->size)
	{
		throw std::invalid_argument("invalid index");
	}
	if (list->size == list->capcity)
	{
		int newcapcity = list->size * 2;
		eleType* newelement = new eleType[newcapcity];
		delete[]list->element;
		
		for (int i = 0; i < (newcapcity/2); i++)
		{
			newelement[i] = list->element[i];
		}
		delete[]list->element;
		list->capcity = newcapcity;
		list->element = newelement;
	}
	list->size++;
	if (list->size < list->capcity)
	{
		for (int i = list->size; i > index; i--)
		{
			list->element[i] = list->element[i - 1];
		}
		list->element[index] = elements;
	}
	
}
void deletement(squencelist* list, int index)
{
	if (index < 0 || index >= list->size)
	{
		throw std::invalid_argument("invalid index");
	}
	for (int i = index; i < list->size - 1; i++)
	{
		list->element[i] = list->element[i + 1];
	}
	list->size--;
}
int findelement(squencelist* list,int element)
{
	for (int i = 0; i < list->size - 1; i++)
	{
		if (list->element[i] ==element)
		{
			return i;
		}
	}
	return -1;
}
eleType getelement(squencelist* list, int index)
{
	if (index < 0 || index >= list->size)
	{
		throw std::invalid_argument("invalid index");
	}
	return list->element[index];
}
void updatement(squencelist* list, int update,int index)
{
	list->element[index] = update;
}
int main()
{
	return 0;
}
